package com.daniel.design.pattern.decorator;

/**
 * @ClassName Egg
 * @Description 鸡蛋类（具体装饰者角色）
 * @Author Daniel
 * @Version V1.0.0
 */
public class Egg extends Garnish {

    public Egg(FastFood fastFood) {
        super(1, "鸡蛋", fastFood);
    }

    @Override
    public double cost() {
        System.out.println("鸡蛋价格：" + getPrice());
        System.out.println("父类中价格：" + super.getPrice());
        System.out.println("炒饭价格：" + getFastFood().getPrice());
        return getPrice() + getFastFood().getPrice();
    }

    @Override
    public String getDesc() {
        System.out.println("鸡蛋描述：" + super.getDesc());
        System.out.println("炒饭描述：" + getFastFood().getDesc());
        return super.getDesc() + getFastFood().getDesc();
    }
}
